/**
 *
 * Copyright (c) 2014-2016 All Rights Reserved.
 */
package org.tinygroup.workflowdemo.integration.impl;

import java.util.ArrayList;
import java.util.List;

import org.tinygroup.workflow.integration.inter.BusinessIdentityService;
import org.tinygroup.workflow.integration.pojo.GroupBean;
import org.tinygroup.workflow.integration.pojo.UserBean;

/**
 * 
 * @author zhangliang08072
 * @version $Id: BusinessIdentityServiceImplTest.java, v 0.1 2016-8-3 下午1:56:15 zhangliang08072 Exp $
 */
public class BusinessIdentityServiceImplTest implements BusinessIdentityService {

	/** 
	 * @see org.tinygroup.workflow.integration.inter.BusinessIdentityService#queryUserById(java.lang.String)
	 */
	@Override
	public UserBean queryUserById(String userId) {
		UserBean user = new UserBean();
		user.setId(userId);
		return user;
	}

	/** 
	 * @see org.tinygroup.workflow.integration.inter.BusinessIdentityService#queryGroupByUser(java.lang.String)
	 */
	@Override
	public List<GroupBean> queryGroupByUser(String userId) {
		String groupId = "";
		if(userId.equals("userA")||userId.equals("userAA")){
			groupId = "groupA";
		} else if(userId.equals("userB")||userId.equals("userBB")){
			groupId = "groupB";
		} else if(userId.equals("userC")||userId.equals("userCC")){
			groupId = "groupC";
		} else if(userId.equals("userD")||userId.equals("userDD")){
			groupId = "groupD";
		}
		GroupBean group = new GroupBean();
		group.setId(groupId);
		
		List<GroupBean> groups = new ArrayList<GroupBean>();
		groups.add(group);
		return groups;
	}

	/** 
	 * @see org.tinygroup.workflow.integration.inter.BusinessIdentityService#queryGroupById(java.lang.String)
	 */
	@Override
	public GroupBean queryGroupById(String groupId) {
		GroupBean group = new GroupBean();
		group.setId(groupId);
		return group;
	}

}
